// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue';
import App from './App';
import router from './router';
import ElementUI from 'element-ui';
import echarts from 'echarts';
import 'element-ui/lib/theme-chalk/index.css';
import './assets/css/css.css';
import Api from './api/index'; //ajax组件
Vue.use(Api)

Vue.use(ElementUI);

Vue.prototype.$echarts = echarts

Vue.config.productionTip = false
Vue.prototype.$Post1 = function (url, postObj, success, failure, isShowLoding, text = "加载中") {
  var _this = this
  this.$http.post1(url, postObj, function (msg) {
    success(msg)
  }, function (err) {
    failure(err)
  })
}
Vue.prototype.$Getgeojson1 = function (url, postObj, success, failure, isShowLoding, text = "加载中") {
  var _this = this
  this.$http.getgeojson1(url, postObj, function (msg) {
    success(msg)
  }, function (err) {
    failure(err)
  })
}
Vue.prototype.$Get1 = function (url, params, success, failure, isShowLoding, text = "加载中") {
  var _this = this
  this.$http.get1(url, params, function (msg) {
    success(msg)
  }, function (err) {
    failure(err)
  })
}

Vue.prototype.$Post2 = function (url, postObj, success, failure, isShowLoding, text = "加载中") {
  var _this = this
  this.$http.post2(url, postObj, function (msg) {
    success(msg)
  }, function (err) {
    failure(err)
  })
}
Vue.prototype.$Getgeojson2 = function (url, postObj, success, failure, isShowLoding, text = "加载中") {
  var _this = this
  this.$http.getgeojson2(url, postObj, function (msg) {
    success(msg)
  }, function (err) {
    failure(err)
  })
}
Vue.prototype.$Get2 = function (url, params, success, failure, isShowLoding, text = "加载中") {
  var _this = this
  this.$http.get2(url, params, function (msg) {
    success(msg)
  }, function (err) {
    failure(err)
  })
}

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  render: h => h(App)
  // components: { App },
  // template: '<App/>'
})
